import 'package:flutter_test/flutter_test.dart';
import 'package:xhs_share/xhs_share.dart';
import 'package:xhs_share/xhs_share_platform_interface.dart';
import 'package:xhs_share/xhs_share_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockXhsSharePlatform
    with MockPlatformInterfaceMixin
    implements XhsSharePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final XhsSharePlatform initialPlatform = XhsSharePlatform.instance;

  test('$MethodChannelXhsShare is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelXhsShare>());
  });

  test('getPlatformVersion', () async {
    XhsShare xhsSharePlugin = XhsShare();
    MockXhsSharePlatform fakePlatform = MockXhsSharePlatform();
    XhsSharePlatform.instance = fakePlatform;

    expect(await xhsSharePlugin.getPlatformVersion(), '42');
  });
}
